package com.xiaoshuidi.cloud.module.member.controller.app.auth;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.member.controller.app.auth.vo.AppAuthSmsSendReqVO;
import com.xiaoshuidi.cloud.module.member.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.member.service.user.MemberUserAuthService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Slf4j
@Tag(name = "租客APP - 会员认证")
@RestController
@RequiredArgsConstructor
@RequestMapping(ApiConstants.NAME + "/member-auth")
public class AppMemberAuthController {
   private final MemberUserAuthService memberUserAuthService;

    @PostMapping("/send-sms-code")
    @Operation(summary = "发送手机验证码")
    public CommonResult<Boolean> sendSmsCode(@RequestBody @Valid AppAuthSmsSendReqVO reqVO) {
        return CommonResult.success(memberUserAuthService.sendSmsCode(reqVO));

    }
}
